<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpnews/list/type/<?php echo $this->type ?>">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>

<?php 
    $this->headScript()->appendFile($this->baseUrl().'/public/js/ckeditor.js' ); 
    $this->headScript()->appendFile($this->baseUrl().'/public/js/ckfinder/ckfinder.js' ); 
?>

<form id="formitem" action="<?php echo $this->baseUrl() ?>/cpnews/item/type/<?php echo $this->type ?><?php echo isSet( $this->news_id ) ? '/id/' . $this->news_id : '' ?>" method="post">
<input type="hidden" name="species" value="<?php echo $this->type ?>" />
<table cellspacing="0" cellpadding="6" class="tform">
	<tr>
		<td class="lb">Tytuł PL:</td>
		<td class="inpy">
			<?php if( isSet( $this->err_title_pl ) ) { ?>
				<input style="border:1px solid red;" type="text" name="title_pl" value="" />
				<div class="formerror"><?php echo $this->err_title_pl ?></div>
			<?php } else { ?>
				<input type="text" name="title_pl" value="<?php echo $this->title_pl ?>" />
			<?php } ?>
		</td>
	</tr>

	<tr>
		<td class="lb">Tytuł EN:</td>
		<td class="inpy"><input type="text" name="title_en" value="<?php echo $this->title_en ?>" /></td>
	</tr>
	<tr>
		<td class="lb">Tytuł CS:</td>
		<td class="inpy"><input type="text" name="title_cs" value="<?php echo $this->title_cs ?>" /></td>
	</tr>
	<tr>
		<td class="lb">Zajawka PL:</td>
		<td class="inpy"><textarea style="height: 90px;" name="lead_pl"><?php echo $this->lead_pl ?></textarea></td>
	
		<?php 
		echo $this->inlineScript()->setScript(' 

		var edytor1 = CKEDITOR.replace( "lead_pl", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		
		CKFinder.setupCKEditor( edytor1, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	
	</tr>
	<tr>
		<td class="lb">Zajawka EN:</td>
		<td class="inpy"><textarea style="height: 90px;" name="lead_en"><?php echo $this->lead_en ?></textarea></td>
	
	<?php 
		echo $this->inlineScript()->setScript(' 

		var edytor2 = CKEDITOR.replace( "lead_en", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		
		CKFinder.setupCKEditor( edytor2, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	
	
	</tr>
	<tr>
		<td class="lb">Zajawka CS:</td>
		<td class="inpy"><textarea style="height: 90px;" name="lead_cs"><?php echo $this->lead_cs ?></textarea></td>
	
	
	<?php 
		echo $this->inlineScript()->setScript(' 

		var edytor3 = CKEDITOR.replace( "lead_cs", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		CKFinder.setupCKEditor( edytor3, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	</tr>
	<tr>
		<td class="lb">Rozwinięcie PL:</td>
		<td class="inpy"><textarea name="body_pl"><?php echo $this->body_pl ?></textarea></td>
	
	<?php 
		echo $this->inlineScript()->setScript(' 

		var edytor4 = CKEDITOR.replace( "body_pl", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		CKFinder.setupCKEditor( edytor4, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	
	</tr>
	<tr>
		<td class="lb">Rozwinięcie EN:</td>
		<td class="inpy"><textarea name="body_en"><?php echo $this->body_en ?></textarea></td>
	
	<?php 

		echo $this->inlineScript()->setScript(' 

		var edytor5 = CKEDITOR.replace( "body_en", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		CKFinder.setupCKEditor( edytor5, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	
	</tr>
	<tr>
		<td class="lb">Rozwinięcie CS:</td>
		<td class="inpy"><textarea name="body_cs"><?php echo $this->body_cs ?></textarea></td>
	
	<?php 

		echo $this->inlineScript()->setScript(' 

		var edytor6 = CKEDITOR.replace( "body_cs", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		CKFinder.setupCKEditor( edytor6, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	
	</tr>
	<tr>
		<td class="lb">News widoczny na stronie głównej:</td>
		<td class="inpy">
			<label><input <?php echo ( $this->main_page == 'yes' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page" value="yes" /> Tak</label>
			<label><input <?php echo ( $this->main_page == 'no' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page" value="no" /> Nie</label>
		</td>
	</tr>
	<tr>
		<td class="lb">Wybór grafiki:</td>
		<td class="inpy">
			<label><input <?php echo ( $this->graph == 1 ) ? 'checked="checked"' : 'checked="checked"'; ?> type="radio" name="graph" value="1" /> Zdjęcie</label>
			<label><input <?php echo ( $this->graph == 2 ) ? 'checked="checked"' : ''; ?> type="radio" name="graph" value="2" /> Miotacz</label>
		</td>
	</tr>
	<tr>
		<td class="lb">Film:</td>
		<td class="inpy">
			<?php  
				$this->fileTypes = '"*.mp4;*.flv"';
				$this->fileTypesDescription = 'Filmy';
				$this->uploadSuccess = 'uploadSuccessMov';
				$this->placeholder = 'spanButtonPlaceholder2';
				$this->progres = 'fsUploadProgress2';
				$this->cancel = 'btnCancel2';
				echo $this->render('global/uploader.phtml'); 
			?>
			<div id="attcont">
			<?php if( $this->mov ) { ?>
				<div class="img2cl" style="width:260px;padding:0px;">
					<a onclick="if( confirmDelete() ){ $( '#attcont' ).empty();  $( '#mov' ).attr({ value : '' })  }" style="padding:0px;opacity:0;margin:0px;text-align:center;background:red;width:100%;" class="delete" href="javascript:void(null)">Usuń</a>
					<div style="width:100%;backgrund:#fafafa;"><div style="padding: 6px;"><?php echo $this->mov ?></div></div>
				</div>
			<?php 
				echo $this->inlineScript()->setScript('
					$( "div.img2cl" ).hover(function(){
						$(this).find( "a" ).css({ opacity: 0, display : "block", cursor : "pointer" }).animate({
							opacity : 0.9
						});
					}, function(){
						$(this).find( "a" ).animate({
							opacity : 0
						});
					});
				');
			}
			?>
			</div>
			<input id="mov" type="hidden" name="mov" value="<?php echo $this->mov ?>" />
			<div>
				<div class="fieldset flash" id="fsUploadProgress2">
					<span class="legend"></span>
				</div>
				<div style="padding-left: 5px;">
					<span id="spanButtonPlaceholder2"></span>
					<input id="btnCancel2" type="button" value="Anuluj" onclick="cancelQueue(upload1);" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;width:120px;" />
					<br />
				</div>
			</div>
		
		</td>
	</tr>

		
	<tr>
		<td class="lb">Galeria:</td>
		<td class="inpy">
			<select name="galeries_g_id">
			<?php foreach( $this->galleriesList as $value ) { ?>
				<option <?php echo ( $this->galeries_g_id == $value['g_id'] ) ? 'selected="selected"' : ''; ?> value="<?php echo $value->g_id ?>"><?php echo $value->name ?></option>
			<?php } ?>
			</select>
		</td>
	</tr>

	<?php 
	//relacje i aktualności mają nie mieć kategorii
	if( $this->type > 2 ) { ?>
	<tr>
		<td class="lb">Kategorie:</td>
		<td class="inpy"><?php echo $this->Categories( $this->categoriesList, $this->categories ) ?></td>
	</tr>
	<?php } ?>

</table>
</form>

		


<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpnews/list/type/<?php echo $this->type ?>">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>